package cn.gailvlun.gll.presentation.xroom.adapter

import android.content.Context
import android.os.Bundle
import android.support.annotation.StringRes
import android.view.View
import android.widget.TextView
import cn.gailvlun.gll.R
import kotlinx.android.synthetic.main.dialog_normal.*

class NormalDialog: BottomDialog<Any> {
    private val title: String?
    private val content: String?
    private val positiveText: String?
    private val negativeText: String?

    constructor(context: Context, title: String?, content: String?, positiveText: String? = null, negativeText: String? = null) : super(context) {
        this.title = title
        this.content = content
        this.positiveText = positiveText
        this.negativeText = negativeText
    }

    override fun getResourceId(): Int = R.layout.dialog_normal

    private var tvTitle: TextView? = null
    private var tvContent: TextView? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        tvPositive?.text = positiveText ?: "确定"
        tvNegative?.text = negativeText ?: "取消"

        tvTitle = findViewById(R.id.tv_title)
        tvContent = findViewById(R.id.tv_content)

        title?.apply {
            tvTitle?.text = title
            tvTitle?.visibility = View.VISIBLE
        }
        content?.apply {
            tvContent?.text = content
            tvContent?.visibility = View.VISIBLE
        }
    }




















}